Skip to content

fix(hosting): export BYO_BRAND so the public ByoValue type resolves - #3336

Closed
sharonyajain wants to merge 1 commit into
mainfrom
fix/hosting-export-byo-brand
Closed

sharonyajain wants to merge 1 commit into
mainfrom
fix/hosting-export-byo-brand

Conversation

@sharonyajain

Copy link
Copy Markdown
Contributor

Problem

check_api_changes is currently failing on main (and therefore on every PR built on it) with a TypeScript compile error in @aws-amplify/hosting:

Error: Validation of @aws-amplify/hosting failed, compiler output:
index.ts: error TS2304: Cannot find name 'BYO_BRAND'.
index.ts: error TS2741: Property '[BYO_BRAND]' is missing in type 'ByoValueBaseline' but required in type 'ByoValue'.

@aws-amplify/hosting exports the ByoValue type, whose shape is { readonly [BYO_BRAND]: true; ... }. But BYO_BRAND is a module-private const in packages/hosting/src/byo.ts (const BYO_BRAND = Symbol.for(...), not exported). When check_api_changes compiles the public API surface, the exported ByoValue references a name that isn't exported alongside it, so the compile fails. This blocks the check on main and on every open PR that includes the hosting package (e.g. #3326, #3329).

Issue number, if available: N/A (CI/tooling fix; main is red on check_api_changes after the standalone-SSR-hosting change)

Changes

  • packages/hosting/src/byo.ts: export the BYO_BRAND symbol so the exported ByoValue type's shape is fully resolvable during API extraction. Runtime behavior is unchanged — it remains the same Symbol.for('@aws-amplify/hosting.byo') registry symbol (the comment already notes Symbol.for is chosen so it survives across module copies).
  • Adds a patch changeset for @aws-amplify/hosting.

No API.md change: api-extractor renders the [BYO_BRAND] computed key in ByoValue the same way whether or not the symbol is exported, so exporting it resolves the compile error with zero change to the emitted public-API surface (verified by regenerating packages/hosting/API.md locally — no diff).

Corresponding docs PR, if applicable: N/A

Validation

  • Built @aws-amplify/hosting locally with @aws-blocks/hosting installed: tsc --build packages/hosting exits 0 (previously failed on the BYO_BRAND reference). The emitted packages/hosting/lib/byo.d.ts now contains export declare const BYO_BRAND: unique symbol;, so the exported ByoValue type resolves.
  • Regenerated packages/hosting/API.md via api-extractor run --local: no change (confirms zero public-API-surface delta).
  • Manual verification: N/A — this is a compile-resolution fix in a build script's input; the check_api_changes CI step is the exercising path.

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

no linked-issue close: CI/tooling fix unblocking check_api_changes on main; not tied to a tracked issue.

@sharonyajain
sharonyajain requested a review from a team as a code owner September 9, 2026 11:32
@changeset-bot

changeset-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 515323a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@aws-amplify/hosting Patch
@aws-amplify/backend-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sharonyajain
sharonyajain force-pushed the fix/hosting-export-byo-brand branch from 077cd3f to fee922d Compare September 9, 2026 12:27
@sharonyajain
sharonyajain requested a review from a team as a code owner September 9, 2026 12:27
…pe resolves

ByoValue was branded with a unique-symbol computed key (BYO_BRAND). The exported type referenced that symbol, but api-extractor omits the Symbol.for() const from the generated API report, leaving API.md self-inconsistent: check_api_changes compiles the report and fails with TS2304 'Cannot find name BYO_BRAND'. This is red on main and blocks every PR built on it. Replace the symbol brand with a literal-typed readonly __byoBrand: true discriminant, which is fully representable in the report. Runtime behavior of byoSecret/byoConfig/isByoValue is unchanged; hosting secret_config tests 6/6 pass.
@sharonyajain
sharonyajain force-pushed the fix/hosting-export-byo-brand branch from fee922d to 515323a Compare September 9, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant